package cn.edu.lingnan;


import cn.edu.lingnan.mapper.QuestionStoreMapper;
import cn.edu.lingnan.user.dtos.Result;
import cn.edu.lingnan.utils.AIApplicationUtils;
import cn.edu.lingnan.utils.AiJudgementUtils;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@Slf4j
@SpringBootTest
public class testbug {


    @Autowired
    QuestionStoreMapper questionStoreMapper;

    @Autowired
    AiJudgementUtils aiJudgementUtils;


    @Test
    public void test(){
        log.warn("sdfsdf{}",questionStoreMapper.getStoreById(29));
    }

    @Test
    public void test2(){
        String question = "请简述数据库设计中的范式化过程及其目的。";
        String userAnwser = "范式化过程是通过一系列规则将数据库表结构逐步优化";
        String correctAnwser = "范式化过程是通过一系列规则将数据库表结构逐步优化，以减少数据冗余和提高数据一致性。其目的是确保数据的完整性和一致性，避免数据异常。";
        String questionScore = "10";
        JSONObject judgement = aiJudgementUtils.judgement(question, userAnwser, correctAnwser, Integer.parseInt(questionScore));
        log.warn("{}",judgement);

    }

//    @Test
//    public void test3(){
//        String question = "帮我生成一道理学高等数学题库相关的简答题（计算题）。";
////        Result aiQuestion =aiJudgementUtils.createAIQuestion(question);
//        log.warn("{}", aiQuestion);
//    }
}
